package scau.erps.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 格式校验器
 * @author DCJ
 *
 */
public class FormatValidation {
	
	/**
	 * 校验时间格式是否符合Y?Q?
	 * @param quarter
	 * @return
	 */
	public static boolean checkFormat(String quarter){
		boolean flag;
		Pattern pattern = Pattern.compile("Y[0-7]Q[1-4]");
		Matcher matcher = pattern.matcher(quarter);
		flag = matcher.matches();
		return flag;
	}

}
